jsool.onReady(function(){
	// Prepare boolean fields
	jsool.select("input.Boolean").each(function(el){
		var inp = jsool.get(el);
		inp.applyStyle("display","none");
		
		var select = js.dom.Helper.append(inp.getParent(),{
			tag: "select",
			children:[{
				tag: "option",
				value:"true",
				html:"True"
			},{
				tag: "option",
				value:"false",
				html:"False"
			}]
		});
		
		function updateValue(ev){
			inp.set("value",select.get("value"));
		};
		
		select = jsool.get(select);
		select.on("click",updateValue);
		select.on("change",updateValue);
		select.on("mouseup",updateValue);
		select.on("mousedown",updateValue);
		select.set("value",inp.get("value"));
		
		var val = inp.get("value");
		
		if(!val || val==""){
			inp.set("value","True");
		}
	});
	
	// Prepare Date fields
	jsool.select("input.Date").each(function(el){
		var inp = jsool.get(el);
		var parent = inp.getParent();
		
		js.dom.Helper.append(parent,{
			tag: 'em',
			html: '(dd/mm/aaaa)'
		});
	});
	
	var allowedKeys = [8,9,35,36,37,39,46,48,49,50,51,52,53,54,56,57];
	jsool.select("input.Number").each(function(el){
		
		var inp = jsool.get(el).on('keypress',function(ev,a){
			return allowedKeys.indexOf(ev.key) >= 0;
		});
	});
});